<?php
if ($_POST['smaz_id']) {
    $count = MySQL_Query("select count(*) as count from chyby");
    for ($i = 0; $i < $count; $i++) {
        $del_id = $checkbox[$i];
        echo $del_id;
        $sql = "DELETE FROM chyby WHERE id='$del_id'";
        $result = mysql_query($sql);
    }
}
echo "<div align=\"center\">";
echo "<table border='1' width=\"1152\">";
$vysledek = mysql_query("SELECT * FROM chyby ORDER BY id DESC LIMIT 30");
while ($zaznam = MySQL_Fetch_Array($vysledek)) {
?>
    <tr>
        <td><?php echo $zaznam['id'] ?> </td>
        <td><?php echo $zaznam['ip'] ?> </td>
        <td><?php echo $zaznam['kdy'] ?> </td>
        <td><?php echo $zaznam['kde'] ?> </td>
        <td><?php echo $zaznam['co'] ?> </td>
        <td><form action="?co=administrace&vyber=4" method="POST" name="smaz_id"> <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $zaznam['id'] ?>" ></td>
                <input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>">
                </tr> <?php } // WHILE ?>
            <tr>
                <td><input type="hidden" name="smaz_id" value="1"><input type="submit" name="smaz_id" value="Smaž <?php echo $zaznam['id'] ?>"></form></td>
</tr> <?php
            echo "</table>";
            echo "</div>";
?>